-
Notifications
You must be signed in to change notification settings - Fork 2.7k
feat(helm): allow extraArgs to also be a map enabling overrides of individual values #5293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(helm): allow extraArgs to also be a map enabling overrides of individual values #5293
Conversation
Hi @frittentheke. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
29f3822
to
98d5ccf
Compare
@frittentheke what about moving the provider specific args into the provider:
name: aws
aws:
customArg: good-default
otherCustomArg: This would be a better pattern for the common use cases as the inputs could be defined in the schema. If you do want to update the extraArgs:
my-arg: test
my-other-arg:
- foo
- bar |
Yes. I am wondering if this would need to happen for all built-in providers in one PR to not make this more complex then necessary (by having e.g. AWS have all its options explicitly defined and others still only via
Wow good catch, thank you @stevehipwell |
I don't think so, we already document providers with configuration support in the chart README. But a provider being added should be fully implemented with a typed JSON schema otherwise it doesn't make much sense.
Yes I agree that adding map support makes sense, there are likely cases where providers don't have specific configuration or where extra args are needed too. |
Any chance to cover this funcitonality with helm unit tests as well? /ok-to-test |
98d5ccf
to
04f4ede
Compare
@stevehipwell I pushed a new revision, including a unit test which @ivankatliarchuk asked for. PTAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
need to re-run linters |
/label tide/merge-method-squash |
04f4ede
to
f76aff7
Compare
Sorry @ivankatliarchuk I missed to run |
/test pull-external-dns-unit-test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking good @frittentheke, just a couple of comments for you.
{{- if kindIs "map" .Values.extraArgs }} | ||
{{- range $key, $value := .Values.extraArgs }} | ||
{{- if not (kindIs "invalid" $value) }} | ||
{{- if kindIs "slice" $value }} | ||
{{- range $value }} | ||
- --{{ $key }}={{ tpl (. | toString) $ }} | ||
{{- end }} | ||
{{- else }} | ||
- --{{ $key }}={{ tpl ($value | toString) $ }} | ||
{{- end }} | ||
{{- else }} | ||
- --{{ $key }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
{{- if kindIs "slice" .Values.extraArgs }} | ||
{{- range .Values.extraArgs }} | ||
- {{ tpl . $ }} | ||
{{- end }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a convention in this chart we keep template directives at the same indentation level as their parent. Could you please follow this pattern here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stevehipwell so you mean no indentation of any of the loops and conditionals then?
I pushed a change - PTAL
f76aff7
to
897b21d
Compare
da0d77d
to
9224250
Compare
Thanks for the quick responses @frittentheke, the changes look good. Sorry for missing this previously but please could you add an entry to the chart CHANGELOG. |
9224250
to
14c3cc9
Compare
DONE @stevehipwell |
Thanks for your patience @frittentheke. /lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ivankatliarchuk, stevehipwell The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Description
With external-dns relying a lot on
extraArgs
for its configuration using a map (key: value) data structure for extraArgs enables a lot more versatility. Multiple values files can be used to e.g. configure common values in one and then only specific values in another.Also setting certain values via
--set
is then possible - e.g to only change a single setting per environment or inject some value dynamically from CI.Checklist
I did update the schema file
Maybe it makes sense to change the documented value type of
extraArgs
to map?